﻿/******************************************************************************
* File description: BoxExpRescue.qml
* Function: 实验恢复弹窗-单个按钮组件
* Current Version: 1.0.0
* Author: JNN
* Date: 2025-07-01
*  -----
*  Copyright by 博坤生物 .
 *****************************************************************************/
import QtQuick 2.0
import "../components"

Rectangle{

    id: root

    property bool isSelected: false
    property string icon: "qrc:/picture/pause.png"
    property bool isHovered: false

    property bool enabled: true

    signal clicked()

    property string content: ""

    radius: 5*dp


    height: 80*dp; width: parent.width
    border.color: isHovered||isSelected ? "#1677FF" : "#11000000"
    color: root.enabled ? (isSelected ? "#091677FF" : "white") : "#F8F8F8"
    Row{
        spacing: 15*dp
        anchors.fill: parent
        Item{ height: 1; width: 1 }
        CustomImage{
            height: 32*dp; width: 32*dp
            source: root.icon
            anchors.verticalCenter: parent.verticalCenter
        }
        Text {
            anchors.verticalCenter: parent.verticalCenter
            text: content
            font.pixelSize: config.fontsize
            color: root.enabled ? "#000" : "#CCCCCC"
        }
    }
    MouseArea{
        anchors.fill: parent
        cursorShape: Qt.PointingHandCursor
        hoverEnabled: true
        onEntered: {
            root.isHovered  = true
        }onExited: {
            root.isHovered = false
        }
        onClicked: {
            if(root.enabled){
                root.clicked()
            }
        }
    }

}
